package fr.imag.m2pgi.m2m.geoloc.scip;

import java.io.IOException;
import java.util.Scanner;

public class MyTest {
  
  static public final int PORT = 1701;
  
  public static void main(String[] args) {
    try {
      SCIP11 laser = new SCIP11(PORT);
      laser.enable();
      String line;
      Scanner s = new Scanner(System.in);
      while((line=s.nextLine())!="quit") {
        try {
          double angle = Double.parseDouble(line);
          int range = laser.getRange(angle);
          System.out.println("Range @"+s+"("+angle+") : "+range);
        } catch(NumberFormatException e) {
          System.err.println("ERROR: Wrong double value: "+line);
        }
      }
      System.out.println("Good bye.");
    } catch (IOException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }    
  }

}
